package com.margo.project.web.schedule;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class MargoScheduleTask {
	private final Logger logger=LoggerFactory.getLogger(MargoScheduleTask.class);
	
	
	/**
	 * 	
	 * 每天凌晨1点执行一次：0 0 1 * * ?
	 * 每天18点执行一次：0 0 18 * * ?
	 * 
	 */
	@Scheduled(cron="0 0 22 * * ?")
	public void taskA() {
		logger.info(Thread.currentThread().getName()+":A定时任务");
	}
	
	@Scheduled(cron="*/20 * 21 * * ?")
	public void taskB() {
		logger.info(Thread.currentThread().getName()+":B定时任务");
	}
}
